package cn.parllay.dingdangproject.global;

import android.content.Context;
import android.view.WindowManager;

import cn.parllay.dingdangproject.DingDangApplication;

/**
 * Created by sunny on 2016/12/5.
 */
public class ScreenInfo {

    private int _width;
    private int _height;

    private ScreenInfo(){
        initializeScreenInfo();
    }

    private void initializeScreenInfo(){

        WindowManager windowManager = (WindowManager) DingDangApplication.getContext().getSystemService(Context.WINDOW_SERVICE);
        _width = windowManager.getDefaultDisplay().getWidth();
        _height = windowManager.getDefaultDisplay().getHeight();

    }
     public static ScreenInfo getInstance() {

         ScreenInfo _instance = null;

         synchronized (ScreenInfo.class){
             if (_instance == null) {
                 _instance = new ScreenInfo();
             }
         }

        return _instance;
    }

    public int getWidth() {
        return _width;
    }

    public int getHeight() {
        return _height;
    }

}
